package com.nick.job.service;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import com.nick.job.domain.JobLog;
import com.nick.job.mapper.JobLogMapper;


/**
 * 定时任务调度日志信息 服务层
 * 
 * @author ruoyi
 * 
 * @version dcliu
 */
public class JobLogServiceImpl  extends SqlSessionDaoSupport implements IJobLogService
{

    public JobLogMapper getJobLogMapper() {
		return getSqlSession().getMapper(JobLogMapper.class);
	}
    /**
     * 获取quartz调度器日志的计划任务
     * 
     * @param jobLog 调度日志信息
     * @return 调度任务日志集合
     */
    @Override
    public List<JobLog> selectJobLogList(JobLog jobLog)
    {
        return getJobLogMapper().selectJobLogList(jobLog);
    }

    /**
     * 通过调度任务日志ID查询调度信息
     * 
     * @param jobId 调度任务日志ID
     * @return 调度任务日志对象信息
     */
    @Override
    public JobLog selectJobLogById(Long jobLogId)
    {
        return getJobLogMapper().selectJobLogById(jobLogId);
    }

    /**
     * 新增任务日志
     * 
     * @param jobLog 调度日志信息
     */
    @Override
    public void addJobLog(JobLog jobLog)
    {
    	getJobLogMapper().insertJobLog(jobLog);
    }

    /**
     * 批量删除调度日志信息
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
//    @Override
//    public int deleteJobLogByIds(String ids)
//    {
//        return jobLogMapper.deleteJobLogByIds(Convert.toStrArray(ids));
//    }

    /**
     * 删除任务日志
     * 
     * @param jobId 调度日志ID
     */
    @Override
    public int deleteJobLogById(Long jobId)
    {
        return getJobLogMapper().deleteJobLogById(jobId);
    }
    
    /**
     * 清空任务日志
     */
    @Override
    public void cleanJobLog()
    {
    	getJobLogMapper().cleanJobLog();
    }
}
